<script setup>
import { ref } from "vue";
import HelloWorld from "./HelloWorld.vue";
const namelistss = ref([1, 2, 3, 4]);
</script>
<template>
  <!-- 作用域匿名插槽 -->
  <HelloWorld :namelistss="namelistss" #default="{ item, index }">
    <button>{{ item }}-{{ index }}</button>
  </HelloWorld>
  <HelloWorld :namelistss="namelistss" #default="{ item, index }">
    <span>{{ item }}-{{ index }}</span>
  </HelloWorld>

  <!-- 作用域具名插槽 -->
  <!-- <HelloWorld :namelistss="namelistss">
    <template #default="{ item, index }">
      <span>{{ item }}-{{ index }}</span>
    </template>
    <template #why="{ item, index }">
      <span>{{ item }}-{{ index }}</span>
    </template>
  </HelloWorld> -->
</template>

<style></style>
